<!--
Copyright 2015 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<kd-content-card class="kd-log-content-card">
  <kd-title class="kd-logs-title">
    [[Logs from|Title prefix for logs card.]]
    <md-select class="kd-logs-toolbar-select"
               ng-model="ctrl.container"
               md-on-close="ctrl.onContainerChange(ctrl.container)"
               required>
      <md-option ng-repeat="item in ctrl.containers"
                 ng-value="item">
        <span class="kd-logs-toolbar-text">{{::item}}</span>
      </md-option>
    </md-select>
    [[in|Title part for logs card.]] {{ctrl.podLogs.info.podName}}
    <div class="kd-logs-style-buttons">
      <md-button class="kd-logs-toolbar-button"
                 ng-click="ctrl.onTextColorChange()">
        <md-icon md-font-library="material-icons"
                 ng-class="ctrl.getColorIconClass()">
          format_color_text
        </md-icon>
      </md-button>
      <md-button class="kd-logs-toolbar-button"
                 ng-click="ctrl.onFontSizeChange()">
        <md-icon md-font-library="material-icons"
                 ng-class="ctrl.getSizeIconClass()">
          text_fields
        </md-icon>
      </md-button>
      <md-button class="kd-logs-toolbar-button"
                 ng-click="ctrl.onShowTimestamp()">
        <md-icon md-font-library="material-icons"
                 class="kd-logs-timer-icon">
          {{ctrl.getTimestampIcon()}}
        </md-icon>
      </md-button>
    </div>
  </kd-title>
  <kd-content>
    <md-virtual-repeat-container class="kd-log-view"
                                 ng-class="ctrl.getStyleClass()"
                                 md-top-index="ctrl.topIndex">
      <div md-virtual-repeat="item in ctrl.logsSet"
           ng-class="ctrl.getLogsClass()">
        <span ng-bind-html="item"
              class="kd-log-line">&nbsp;</span>
      </div>
    </md-virtual-repeat-container>
  </kd-content>
  <kd-footer>
    <div layout="row">
      <span class="kd-logs-info"
            ng-show="ctrl.logsSet.length > 1">
        [[Logs from|Title prefix for logs card.]]
        {{ctrl.podLogs.info.fromDate | date : "short"}}
        [[to|Footer part for logs card.]]
        {{ctrl.podLogs.info.toDate | date : "short" }}
      </span>
      <span flex></span>
      <div class="kd-list-pagination-buttons">
        <md-button class="md-icon-button md-button md-ink-ripple"
                   ng-click="ctrl.loadOldest()">
          <md-icon>first_page</md-icon>
        </md-button>
        <md-button class="md-icon-button md-button md-ink-ripple"
                   ng-click="ctrl.loadOlder()">
          <md-icon>chevron_left</md-icon>
        </md-button>
        <md-button class="md-icon-button md-button md-ink-ripple"
                   ng-click="ctrl.loadNewer()">
          <md-icon>chevron_right</md-icon>
        </md-button>
        <md-button class="md-icon-button md-button md-ink-ripple"
                   ng-click="ctrl.loadNewest()">
          <md-icon>last_page</md-icon>
        </md-button>
      </div>
    </div>
  </kd-footer>
</kd-content-card>
